#ifndef LOGINDIALOG_H
#define LOGINDIALOG_H

#include <QDialog>
#include <QLineEdit>
#include <QPushButton>
#include <QLabel>
#include <QFormLayout>
#include "sqloperator.h"

#include "widget.h"
class LoginDialog : public QDialog
{
    Q_OBJECT

public:
    LoginDialog(QWidget *parent = nullptr, SqlOperator *sqlOperator = nullptr);
    ~LoginDialog();

signals:
    void loginSuccess(const QString &username);

private slots:
    void onLoginClicked();
    void onCancelClicked();

private:
    void setupUI();

    QLineEdit *m_usernameEdit;
    QLineEdit *m_passwordEdit;
    QPushButton *m_loginBtn;
    QPushButton *m_cancelBtn;
    SqlOperator *m_sqlOperator;
    Widget *widget_view;

};

#endif // LOGIN_DIALOG_H
